import FlowZoom from './FlowZoom.vue';
import FlowMap from './FlowMap.vue';
import FlowNav from './FlowNav.vue';
import FlowHelper from './FlowHelper.vue';
import FlowTips from './FlowTips.vue';


const Components = {
    FlowZoom,
    FlowMap,
    FlowNav,
    FlowHelper,
    FlowTips
  };

// for in 方法
// export const registerComponents = (app) => {
//     for (let item in Components) {
//       console.log(item)
//       app.component(item, Components[item])
//     }
//   }
  
  // Object.keys() 方法
  // Object.keys()会返回一个由一个给定对象的自身可枚举属性组成的数组，数组中属性名的排列顺序和正常循环遍历该对象时返回的顺序一致
  export const registerComponents = (app) => {
    Object.keys(Components).forEach((key) => {
      app.component(key, Components[key]);
    });
  };